//
// Created by Administrator on 2020/6/28.
//函数重载:C++允许功能相近的函数在相同的作用域内以相同的函数名声明，从而形成重载。方便使用，便于记忆
//形参类型不同
/*
int add(int x,int y);
float add(float x,float y);
*/

//形参个数不同
/*
int add(int x,int y);
int add(int x,int y,int z);
*/

#include <iostream>
using namespace std;
int sumOfSquare(int a,int b)
{
    return a*a+b*b;
}
double sumOfSquare(double a,double b)
{
    return a*a+b*b;
}
int main()
{
    int m,n;
    cout<<"Enter two integer:";
    cin>>m>>n;
    cout<<"Their sum of square:"<<sumOfSquare(m,n)<<endl;
    double x,y;
    cout<<"Enter two real number:";
    cin>>x>>y;
    cout<<"Their sum of square:"<<sumOfSquare(x,y)<<endl;
    return 0;
}